import Vue from 'vue'
import VueRouter from 'vue-router'
import Manage from '../views/Manage.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        redirect: '/home', // 重定向到首页
        name: 'Manage',
        component: Manage,
        children: [
            {
                path: 'home',
                name: '首页',
                component: () => import('../views/HomeView.vue'),
                meta: {title: "首页", requiresAuth: true}
            }, {
                path: 'about',
                name: '关于',
                component: () => import('../views/AboutView.vue'),
                meta: {title: "关于", requiresAuth: true}
            },{
                path: 'contact',
                name: 'contact',
                component: () => import('../views/Contact.vue'),
                meta: {title: "联系我", requiresAuth: true}
            },
        ]
    },
]

const router = new VueRouter({
    routes
})

export default router
